package com.sgb.kjwl.view.widget;

import android.app.Dialog;
import android.content.Context;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;


//更改报价、
public class ChangPriceDialog extends Dialog {

    private static int default_width = 250;//默认宽度
    private static int default_height = 270;//默认高度


    public ChangPriceDialog(Context context, View layout, int style) {
        this(context, default_width, default_height, layout, style);
    }

    public ChangPriceDialog(Context context, int width, int height, View layout, int style) {
        super(context, style);
        setContentView(layout);
        DisplayMetrics displayMetrics=context.getResources().getDisplayMetrics();
//        int h= (int) (displayMetrics.heightPixels*0.3);
        int w= (int) (displayMetrics.widthPixels*0.8);
        Window window = getWindow();
        WindowManager.LayoutParams params = window.getAttributes();
//        params.height=h;
        params.width=w;
        params.gravity = Gravity.CENTER;
        window.setAttributes(params);
    }



}

